<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');

Class Init {
	private $CI;
	function settingup(){
    PageUtil::registerVar("javascript",TRUE);
		PageUtil::registerVar("javascript_body",TRUE);
		PageUtil::registerVar("stylesheet",TRUE);
		PageUtil::registerVar("title",TRUE);
		PageUtil::registerVar("keywords",TRUE);
		PageUtil::registerVar("description",TRUE);
	}
	function checkPermission(){
		$this->CI =& get_instance();

		$user_data = $this->CI->session->userdata("user_data");

		if($this->CI->uri->segment(1) == "admin"){
			$is_loggedin = $this->CI->session->userdata("is_loggedin");
      if(empty($user_data["group"]) OR ($user_data["group"] != 2) OR !$is_loggedin){
        show_404();
      }
    }
	}
}